<template>
  <div class="goods" @scroll="scroll">
    <goods-list-item
      class="goods-item"
      v-for="(item, index) in goods"
      :key="index"
      :goodsitem="item"
    />
  </div>
</template>

<script>
import GoodsListItem from "./GoodsListItem.vue";
export default {
  name: "GoodsList",
  props: {
    goods: {
      type: Array,
      default() {
        return [];
      },
    },
  },
  methods: {
    scroll(e) {
      console.log(e);
    },
  },
  components: {
    GoodsListItem,
  },
};
</script>

<style scoped>
.goods {
  padding: 0 10px;
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
}
.goods-item {
  width: 48%;
  margin-top: 15px;
  padding-bottom: 70px;
  box-shadow: 0 1px 2px 0px rgba(100, 100, 100, 0.2);
}
</style>